import { View } from "../../../../mvc/core/View";
import { AutoFeedCheckBoxSprite } from "../../autoFeed/AutoFeedCheckBoxSprite";
import { ObjCreate } from "../../common/ObjCreate";
import { Language } from "../../../../../extend/language/Language";
import { ImagesConst } from "../../../resource/ImagesConst";
import { FashionJewelTargetData } from "./FashionJewelTargetData";
import { GameDefConfig } from "../../../resource/GameDefConfig";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
type int = number;
//class FashionJewelTargetTipsPart
    
    export  class FashionJewelTargetTipsPart extends View
    {
        constructor()
        {
            super();
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            this._colorSp = new AutoFeedCheckBoxSprite();
            addChild(this._colorSp);
            this._targetLvTx = ObjCreate.createGTextField(Language.getStringByParam(74611, 2, 1, 2), 0, 1, 140, 20, this._colorSp);
            this._attriTx = ObjCreate.createGTextField("", 0, 21, 128, 20, this._colorSp);
            this._attriTx.wordWrap = true;
            this._attriTx.multiline = true;
            this._attriTx.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._isOpenTx = ObjCreate.createGTextField("", 128, 1, 48, 20, this);
            this._line = ObjCreate.createBg(10, 2, 130, 1, this, ImagesConst.SeptalLine);
            return;
        }

        public updateInfo(arg1: FashionJewelTargetData, arg2: int): void
        {
            var loc1=0;
            var loc2=null;
            var loc3=0;
            if (arg1) 
            {
                this._targetLvTx.htmlText = Language.getStringByParam(74611, arg1.targetLv, arg1.openNum, arg2);
                loc1 = arg1.attArr.length;
                loc2 = "<font color=\'#F1FFB1\'>" + Language.getString(79021) + "</font>";
                loc3 = 0;
                while (loc3 < loc1) 
                {
                    loc2 = loc2 + ("<br>" + GameDefConfig.instance.getEJewel(arg1.attArr[loc3]).text1 + " + " + arg1.arrNum[arg1.attArr[loc3]]);
                    ++loc3;
                }
                this._attriTx.htmlText = "<textformat leading=\'2\'><font color=\'#00ff00\'>" + loc2 + "</font></textformat>";
                if (arg1.isOpen) 
                {
                    this._isOpenTx.htmlText = Language.getString(79022);
                    this._colorSp.filters = [];
                }
                else 
                {
                    this._isOpenTx.htmlText = Language.getString(79023);
                    this._colorSp.filters = [FilterConst.colorFilter];
                }
                this._line.y = 43 + 13 * loc1 + 2;
                this._higNum = this._line.y + 2;
                this._colorSp.height = this._higNum;
            }
            else 
            {
                this._higNum = 100;
            }
            return;
        }

        public /* override */ get height(): number
        {
            return this._higNum;
        }

        /* internal */ /* var */_line: ScaleBitmap;

        /* internal */ /* var */_colorSp: AutoFeedCheckBoxSprite;

        /* internal */ /* var */_targetLvTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_attriTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_higNum: int;

        /* internal */ /* var */_isOpenTx: Object /* flash.text.TextField */;
    }
